package com.ff.neuropp.controller;


import com.ff.neuropp.domain.Evaluation;
import com.ff.neuropp.service.AppEvaluateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/app/evaluate")
@Api(value = "app评价controller", tags = {"app评价接口"})
public class AppEvaluateController {

    @Autowired
    private AppEvaluateService appEvaluateService;


    @PostMapping("/add")
    @ApiOperation(value = "添加评价信息", notes = "添加评价信息")
    public Map<String,Object> evaluate(@RequestBody Evaluation param){
        return appEvaluateService.addEvaluation(param);
    }


    @GetMapping("/info")
    @ApiOperation(value = "查询评价信息", notes = "查询评价信息")
    public Map<String,Object> info(@ApiParam(required = true,value = "userId") @RequestParam String userId){
        return appEvaluateService.evalutions(userId);
    }


}
